// store.js
import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        locale: 'zh-cn', // 默认语言
    },
    mutations: {
        SET_LOCALE(state, locale) {
            state.locale = locale;
        },
    },
    actions: {
        setLocale({ commit }, locale) {
            commit('SET_LOCALE', locale);
        },
    },
});
